package com.jrauto.CarAppBackend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 车辆图片和视频
 * @TableName car_media
 */

@TableName(value ="car_media")
@Data
public class CarMedia implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 关联车辆ID
     */
    private Integer carId;

    /**
     * 媒体类型
     */
    private Integer type;

    /**
     * 资源URL
     */
    private String url;

    /**
     * 上传时间
     */
    private Date createdAt;


    private Integer orderIndex; // 图片显示顺序

    // 辅助字段，方便在后端处理时存储 COS Key，数据库中不存在，不会映射
    @TableField(exist = false)
    private String cosKey;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCarId() {
        return carId;
    }

    public void setCarId(Integer carId) {
        this.carId = carId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }



    public Integer getOrderIndex() {
        return orderIndex;
    }

    public void setOrderIndex(Integer orderIndex) {
        this.orderIndex = orderIndex;
    }

    public String getCosKey() {
        return cosKey;
    }

    public void setCosKey(String cosKey) {
        this.cosKey = cosKey;
    }



}